
const byte veMap[16][16] ={
{26,    26,     29,     34,     40,     46,     50,     55,     58,     61,     61,     60,     59,     59,     58,     58},
{38,    37,     39,     44,     53,     61,     65,     67,     69,     73,     71,     66,     64,     62,     60,     58},
{43,    42,     43,     45,     54,     63,     66,     69,     71,     75,     73,     67,     65,     63,     61,     59},
{48,    46,     48,     50,     58,     65,     69,     71,     73,     77,     75,     69,     67,     65,     63,     61},
{52,    51,     52,     55,     62,     67,     71,     73,     75,     79,     77,     71,     69,     67,     65,     63},
{57,    59,     61,     65,     69,     72,     76,     78,     81,     85,     85,     80,     78,     76,     74,     72},
{61,    62,     65,     69,     72,     75,     79,     82,     85,     89,     88,     84,     82,     80,     78,     76},
{65,    66,     69,     73,     76,     78,     82,     86,     90,     93,     92,     88,     86,     84,     82,     80},
{68,    70,     73,     78,     81,     83,     86,     90,     94,     98,     97,     93,     91,     89,     87,     85},
{72,    77,     82,     87,     90,     93,     95,     100,    105,    109,    108,    103,    101,    99,     97,     95},
{74,    82,     87,     92,     96,     98,     101,    106,    112,    115,    114,    109,    107,    105,    103,    101},
{75,    83,     88,     93,     97,     99,     102,    107,    113,    116,    115,    110,    108,    106,    104,    102},
{78,    85,     90,     95,     99,     101,    104,    109,    115,    118,    117,    112,    110,    108,    106,    100},
{82,    89,     94,     100,    104,    106,    109,    114,    121,    124,    123,    118,    115,    113,    111,    105},
{86,    93,     94,     100,    104,    111,    109,    120,    126,    130,    129,    123,    121,    119,    116,    110},
{90,    98,     103,    109,    114,    116,    120,    125,    132,    136,    134,    129,    126,    124,    122,    115}
};

//Map<Alpha<uint16>,uint16,16,uint16,16> ve(veMap);
engine.ve1().load(veMap, false);
engine.ve1().x().set((uint16[16]){500,800,1100,1400,2000,2600,3100,3700,4300,4900,5400,6000,6500,7000,7200,7500});
engine.ve1().y().set((uint16[16]){30,40,45,50,55,60,65,70,75,80,90,95,100,200,300,400});

engine.ve1().dump();
printf("3800 RPM, 85%% = %d\n", (int)engine.ve1().lookup(3800, 85).value());

//ve.data()[8][9].setNull(true);
//ve.set(0,8,9); // 7,9
/*
ve.get(7,9).setNull(true);
ve.dump();

printf("16x16 vetable = %d bytes\n", sizeof(ve));
printf("3800 RPM, 85%% = %d\n", ve.lookup(3800, 85).value());
*/
